#!/bin/bash

while [ 1 ]
do
    if ! $(pidof smart_home &> /dev/null) ; then
        echo "system crashed on `date`" >> crash.log
        ./start_server.sh
    fi
    sleep 1
done
